package com.karry.yl.dao.healthdata;

import com.karry.commons.base.SuperMapper;
import com.karry.yl.domain.healthdata.HealthData;
import org.apache.ibatis.annotations.Select;

import java.util.List;


public interface HealthDataMapper extends SuperMapper<HealthData> {

    @Select("select a.* from health_data as a, (select healthDataItemId as healthDataItemId, max(createdTime) as createdTime from health_data where elderlyId=#{elderlyId} group by healthDataItemId ) as b where a.healthDataItemId=b.healthDataItemId and a.createdTime = b.createdTime")
    List<HealthData> selectByElderlyId(Long elderlyId);
}
